//
//  CollectionViewCell.m
//  InSuger
//
//  Created by dllo on 15/11/27.
//  Copyright © 2015年 Dior_3g. All rights reserved.
//

#import "CollectionViewCell.h"
#import "Header.h"
@implementation CollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createCell];
    }
    return self;
}
- (void)createCell
{   
    self.leftImageView = [[UIImageView alloc] initWithFrame:CGRectMake(5,10, 50, 50)];
    self.leftImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0.026667 * self.contentView.frame.size.width,0.1411 * self.contentView.frame.size.height, 0.26667 * self.contentView.frame.size.width, 0.7054674 * self.contentView.frame.size.height)];
    [self.contentView addSubview:self.leftImageView];
 
    self.headLabel = [[UILabel alloc] initWithFrame:CGRectMake(0.298667 * self.contentView.frame.size.width, 0.1411 * self.contentView.frame.size.height, 0.64 * self.contentView.frame.size.width, 0.338624 * self.contentView.frame.size.height)];
    [self.contentView addSubview:self.headLabel];
    self.headLabel.font = [UIFont systemFontOfSize:11.0];
//    self.headLabel.backgroundColor = [UIColor greenColor];
    
    self.footLabel = [[UILabel alloc] initWithFrame:CGRectMake(0.298667 * self.contentView.frame.size.width, 0.493827 * self.contentView.frame.size.height, 0.64 * self.contentView.frame.size.width, 0.338624 * self.contentView.frame.size.height)];
    [self.contentView addSubview:self.footLabel];
    self.footLabel.font = [UIFont systemFontOfSize:9.0];
    self.footLabel.textColor = [UIColor grayColor];
//    self.footLabel.backgroundColor = [UIColor orangeColor];
    @weakify(self);
    [self addColorChangedBlock:^() {
        @strongify(self);
        
        self.contentView.nightBackgroundColor = UIColorFromRGB(0x343434);
        self.contentView.normalBackgroundColor = [UIColor whiteColor];
        self.leftImageView.nightBackgroundColor = UIColorFromRGB(0x343434);

        self.headLabel.nightTextColor = [UIColor whiteColor];
        

        self.footLabel.nightTextColor = [UIColor whiteColor];

        
    }];
    
}


@end
